<template>
  <div>
    <van-popup round :close-on-click-overlay="true" teleport="body" :show="isShow" position="bottom">
      <van-picker :title="title" :columns="pickerList" @confirm="confirm" @cancel="close" />
    </van-popup>
  </div>
</template>

<script setup lang="ts">
withDefaults(
  defineProps<{
    pickerList: any[];
    isShow: boolean;
    title: string;
  }>(),
  {
    pickerList: [] as any,
    isShow: false,
    title: "默认title",
  }
);

const emits = defineEmits(["confirm", "close"]);
const confirm = (params: any) => {
  emits("confirm", params);
};

const close = () => {
  emits("close");
};
</script>

<style scoped></style>

<!-- 时间pick组件
  /////template/////
    <van-popup v-model:show="timeShowPop" position="bottom">
      <van-picker-group
        title="日期选择"
        :tabs="['选择日期', '选择时间']"
        next-step-text="下一步"
        @confirm="timeConfirm"
        @cancel="timeShowPop = false"
      >
        <van-date-picker
          v-model="(currentDate as any)"
          :min-date="minDate"
          :max-date="maxDate"
        />
        <van-time-picker v-model="(currentTime as any)" />
      </van-picker-group>
    </van-popup>


  /////script/////

import { getNowFormatDate, minDate, maxDate } from "../utils/issues";
const timeShowPop = ref(false);
const timeConfirm = (params: any) => {
  console.log(params, "params");
  timeShowPop.value = false;
};
const currentDate = ref(getNowFormatDate());
const currentTime = ref(["00", "00"]);

-->
